<template>
	<div id="app">
		<el-button @click="getData">加载数据</el-button>
		<el-tabs v-model="activeName">
			<el-tab-pane label="用户管理" name="UserList"></el-tab-pane>
			<el-tab-pane label="其他" name="Aname"></el-tab-pane>
		</el-tabs>
		<component :is="activeName" :userList="list"></component>
	</div>
</template>

<script>
// import UserList from './components/userList.vue'
import { store } from "./storeData"

export default {
  name: 'App',
  components: {
    UserList:()=>import('./components/userList.vue'),
    Aname:()=>import('./components/userList.vue')
  },
  data() {
    return {
      list: [],
      activeName:"Aname"
    }
  },
  methods: {
    getData() {
      this.$axios.get("http://192.168.124.30:7300/mock/6455b32d4181df001e452779/wms/userList").then(res => {
      console.log(res);
      if (res.data.code == 0) {
        // this.list = Object.freeze(res.data.data);
        store.list = Object.freeze(res.data.data)
      }
     })
    }
  },
  mounted() {

  }
}
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
